<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-1.11.1.js"></script>
		<style>
			div#tab div{
				posit ion: relative;
				float: left;
				margin-right: 10px;
				padding: 20px 40px;
				bor der: 1px solid red;
				background: #eee;
			}
			div#tab div#tab1{
				background: #ffcc00;
			}
			#text{
				bor der: 1px solid red;
				width: 700px;
				height: 400px;
				position: absolute;
				margin-top: 60px;
				text-align: center;
				line-height: 400px;
				background: #ffcc00;
			}
		</style>
	</head>
	<body>
		<div id="tab">
			<div id="tab1">tab01</div>
			<div id="tab2">tab02</div>
			<div id="tab3">tab03</div>
		</div>
		<div id="text">tab文本内容一</div>
		<script>
			$("#tab1").click(function(){
				$("#tab1").siblings().css("background-color","#eee");
				$("#tab1").css("background-color","#ffcc00");
				$("#text").text("tab文本内容一")
			});
			$("#tab2").click(function(){
				$("#tab2").siblings().css("background-color","#eee");
				$("#tab2").css("background-color","#ffcc00");
				$("#text").text("tab文本内容二")
			});
			$("#tab3").click(function(){
				$("#tab3").siblings().css("background-color","#eee");
				$("#tab3").css("background-color","#ffcc00");
				$("#text").text("tab文本内容三")
			});
		</script>
	</body>
</html>